package com.pactera.asmp.server.dao;

import com.pactera.asmp.server.entity.ConstantModuleStatisticsDataDTO;
import com.pactera.asmp.server.entity.ProjectStatisticsDataDTO;
import com.pactera.asmp.server.entity.ScriptInfoDTO;
import com.pactera.asmp.server.entity.ScriptInfoSearchDTO;
import com.pactera.asmp.server.entity.ScriptModuleStatisticsDataDTO;
import com.pactera.asmp.server.entity.ScriptStatisticsDataDTO;
import com.pactera.asmp.server.pojo.ScriptInfo;
import com.pactera.asmp.server.pojo.ScriptInfo2;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ProjectName: asmp-server
 * @Package com.pactera.asmp.server.dao
 * @ClassName: ScriptInfoMapper
 * @Description: ScriptInfoMapper
 * @Date 2020/07/14 17:12
 * @Author lvzhiqiang
 * @Version 1.0
 */
@Mapper
public interface ScriptInfoMapper {

    List<ScriptInfo> select(ScriptInfoSearchDTO scriptInfoSearchDTO);

    List<ScriptInfo> selectScriptByGroupIds(List<Integer> groupIds);

    List<ScriptInfo> selectScriptByGroupId(Integer groupId);

    ScriptInfo selectScriptByScriptId(Integer scriptId);

    List<ScriptInfo2> selectScriptByScriptIds(@Param("scriptIds") List<Integer> scriptIds);

    int insert( ScriptInfoDTO scriptInfoDTO);

    int insertScriptAndGroupRel(@Param("groupId") Integer groupId, @Param("id") Integer id);

    int update(ScriptInfo scriptInfo);

    int deleteByPrimaryKey(Integer id);

    int deleteByPrimaryKeys(@Param("datas") List<Integer> datas);

    List<ScriptInfo> getScriptModuleByIds(@Param("ids") Integer[] ids);

    List<ScriptInfo2> getScriptByNamesAndProjecModuletIds(@Param("names") List<String> names, @Param("projecModuletIds") List<Integer> projectIds);

    List<ScriptInfo2> getScriptByProjecModuletIds(@Param("projecModuletIds") List<Integer> projectIds);

    List<ScriptModuleStatisticsDataDTO> summaryModuleScriptInfoByProjectId(@Param("projectId") Integer projectId);

    Long summaryScriptInfoByProjectId(@Param("projectId") Integer projectId);

    List<ScriptStatisticsDataDTO> summaryScriptInfoByProject();

    List<ScriptInfo2> selectScriptByScriptIdsWithoutStatus(@Param("scriptIds") List<Integer> scriptIds);

}
